from django.db import models
from django.contrib.auth.models import User

class Persona(models.Model):
    nombre = models.CharField(max_length = 30)
    apellido = models.CharField(max_length = 30)
    dni = models.CharField(max_length = 10)
    direccion = models.CharField(max_length = 50)
    telefono = models.CharField(max_length = 20)
    
    def __unicode__(self, ):
        return self.nombre + self.apellido

class Medico(Persona):
    #codigoMedico = models.CharField(max_length = 20, primary_key= True) 
    #se borra para que django genere un id para cada medico

    matricula = models.CharField(max_length = 10)
    especialidad = models.CharField(max_length = 20)
    horarioAtencionMin = models.TimeField()
    horarioAtencionMax = models.TimeField()
    
    def __unicode__(self, ):
        return self.nombre + " " +self.apellido

class Paciente(Persona):
    #codigoPaciente = models.IntegerField(max_length = 20, primary_key = True)
    edad = models.CharField(max_length = 3)
    obraSocial = models.CharField(max_length = 20)
    
    def __unicode__(self, ):
        return self.nombre + self.apellido

class Secretaria(Persona):
    #codigoSecretaria = models.CharField(max_length = 20, primary_key = True)
    horarioAtencionMin = models.TimeField()
    horarioAtencionMax = models.TimeField()
    
    def __unicode__(self, ):
        return self.nombre + self.apellido
    
# class Turno(object):
#     codigoTurno = models.CharField(max_length = 20, primary_key = True)
#     #codigoPaciente = models.CharField(max_length = 20)
#     #codigoSecretaria = models.CharField(max_length = 20)
#     codigoPaciente = models.ForeignKey(paciente)
#     codigoSecretaria = models.ForeignKey(secretaria)
#     fecha = models.DateField()
#     hora = models.TimeField()

#     def __unicode__(self, ):
#         return self.codigoTurno

# class HistoriaClinica(object):
#     """docstring for historiaClinica"""
#     codigoHistoriaClinica = models.CharField(max_length = 20, primary_key = True)
#     #codigoMedico = models.CharField(max_length = 20)
#     #codigoPaciente =  models.CharField(max_length = 20)
#     descripcionHistoriaClinica= models.CharField(max_length= 100)
#     codigoMedico  = models.ForeignKey(medico)
#     codigoPaciente = models.ForeignKey(paciente)

#     def __unicode__(self, ):
#         return self.texto

# class Consulta(object):
#     """docstring for consulta"""
#     codigoConsulta = models.CharField(max_length = 20, primary_key = True)
#     descripcionConsulta = models.CharField (max_length = 100)
#     codigoHistoriaClinica = models.ForeignKey(historiaClinica)

#     def __unicode__(self, ):
#         return self.texto

# class Diagnostico(object):
#     """docstring for diagnostico"""
#     codigoDiagnostico= models.CharField(max_length = 20,primary_key = True)
#     codigoConsulta = models.ForeignKey(consulta)
#     descripcionDiagnostico = models.TextField()

#     def __unicode__(self, ):
#         return self.texto

#class Informe(object):
    #code
    
#class HistoriaClinica(object):
    #code
    
#class Antecedentes(object):
    #code
    
#class TipoAntecedente(object):
    
    #code

#class Diagnostico(object):
    #code
    
#class Tratamiento(object):
    #code

#class Medicamento(object):
    #code
    
#class TratamientoMedicamento(object):
